package com.raising.modules.sys.service;

import com.raising.framework.service.CrudService;
import com.raising.modules.sys.dao.SessionsDao;
import com.raising.modules.sys.entity.Sessions;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
* session管理 Service层
* @author gaoy
* @version 1.0
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SessionService extends CrudService<SessionsDao, Sessions> {

    /**
     * 新增会话
     * @param sessions
     * @return
     */
    @Transactional(readOnly = false)
    public int add(Sessions sessions){
        return dao.insert(sessions);
    }

    /**
     * 更新会话
     * @param sessions
     * @return
     */
    @Transactional(readOnly = false)
    public int update(Sessions sessions){
        return dao.update(sessions);
    }

}
